package fastwave.cloud.demo.fastwave.biz.publisher.controller;

import fastwave.cloud.demo.fastwave.biz.publisher.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>Title: TransController</p>
 *
 * @author: dwLiu
 * @date: 2020/4/11 22:15
 */
@RestController
@RequestMapping("trans")
public class TransController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/transfer")
    public String transfer(@RequestParam Map<String, Object> param) throws Exception {
        try {
            accountService.transfer(param);
        } catch (Exception e) {
            return "转账失败";
        }
        return "转账成功";
    }
}
